home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-09-14 | 3.3 KB | 99 lines | [TEXT/MPS ] |
- {------------------------------------------------------------------------------
- #
- # Macintosh Developer Technical Support
- #
- # Copyright © 1989 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions: 0.0 4/89
- #
- #
- ------------------------------------------------------------------------------}
-
-
- UNIT MonExtendCDEV;
-
- INTERFACE
-
- USES
-
- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
-
- CONST
-
- textItm = 1; {first editTExt item in cdev}
-
- SlotCount = 6; { a reasonable value, isn't it? }
- INITMSG = 1; {sent before the dialog is actually displayed}
- OKMSG = 2; {indicates we are quitting and actions should stick}
- CANCELMSG = 3; {indicates we are quitting and actions should not stick}
- HITMSG = 4; {sent when an extensions control is hit}
- NULMSG = 5; {a periodic event}
- UPDATEMSG = 6; {this SHOULD be handled by user code and built-in controls}
- ACTIVATEMSG = 7; {currently not used as we are a modalDialog}
- DEACTIVATEMSG = 8; {currently not used as we are a modalDialog}
- KEYEVTMSG = 9; {sent for keyboard events. EditText should handle automatically}
- SUPERMSG = 10; {sent if should show Super User controls}
- NORMALMSG = 11; {sent if should not show Super User controls}
- STARTUPMSG = 12; {sent as soon as the code is loaded, before any resources are found}
-
- TYPE
- ScrnRecord = RECORD {‘scrn’ info for each screen}
- srDrvrHW: INTEGER; {spDrvrHW from slot decl mgr’s device type}
- srSlot: INTEGER; {Slot number for the screen’s video card}
- srDCtlDevBase: LONGINT; {Base address of card’s memory}
- srMode: INTEGER; {sRsrcID for desired mode}
- srFlagMask: INTEGER; {$77FE}
- srFlags: INTEGER; {active, main screen, B/W or color}
- srColorTable: INTEGER; {Resource ID of desired ‘clut’}
- srGammaTable: INTEGER; {Resource ID of desired ‘gama’}
- srRect: Rect; {Device’s rectangle, global coordinates}
- srCtlCount: INTEGER; {Number of control calls}
- END;
- ScrnRecordPtr = ^ScrnRecord;
- ScrnRecordHandle = ^ScrnRecordPtr;
-
- ScrnRsrc = RECORD {Complete ‘scrn’ resource}
- count: INTEGER; {Number of screens configured here}
- scrnRecs: ARRAY[1..SlotCount] OF ScrnRecord; {Config for @ one}
- END;
- ScrnRsrcPtr = ^ScrnRsrc;
- ScrnRsrcHandle = ^ScrnRsrcPtr;
-
- CodePtr = ^LONGINT; {Dummy pointer type}
-
- FUNCTION MonExtend ( message, {the action to handle}
- Item, {the DITL item hit or 0}
- numItems: INTEGER; {the number of Monitors last item}
- monitorValue: LONGINT; {value returned last time. Defaults to 0}
- mDialog: DialogPtr; {the dialog pointer}
- theEvent: EventRecord; {event that caused the message to happen}
- ScreenNum: INTEGER; {the number of the screen to affect}
- VAR Screens: ScrnRsrcHandle; {the screen resource to change if desired}
- VAR ScrnChanged: BOOLEAN {TRUE if Monitors should clean up Screens}
- ):LONGINT; {value to pass back as monitorValue or an error code}
-
-
- IMPLEMENTATION
-
- FUNCTION MonExtend ( message,Item,numItems: INTEGER;
- monitorValue: LONGINT;
- mDialog: DialogPtr;
- theEvent: EventRecord;
- ScreenNum: INTEGER;
- VAR Screens: ScrnRsrcHandle;
- VAR ScrnChanged: BOOLEAN
- ):LONGINT;
-
- VAR
- tempChar : CHAR;
- BEGIN
- CASE message OF
- initMSG: {initialize cdev}
- BEGIN
- {Let do nothing at all}
- END;
- END;
- MonExtend := monitorValue; { return old value }
- END; {MonExtend}
- END.